# encoding=utf-8

import numpy as np

array = np.arange(12).reshape((3, 4))
print("array=", array)

# 纵向分割
print(np.split(array, 2, axis=1))
# 横向分割
print(np.split(array, 3, axis=0))
# 错误的分割
# print(np.split(array, 3, axis=1))
# 不等量的分割
print(np.array_split(array, 3, axis=1))

print(np.vsplit(array, 3))  # 等于 print(np.split(A, 3, axis=0))
print(np.hsplit(array, 2))  # 等于 print(np.split(A, 2, axis=1))